<?php // Do not delete these lines
	if ( ! defined('HABARI_PATH' ) ) { die( _t('Please do not load this page directly. Thanks!') ); }
?>


<?php if( $post->comments->pingbacks->count || $post->comments->moderated->count ) : ?>
	<section id="comments">
	<?php /* if( $post->comments->pingbacks->count ) : ?>
			<h3><?php echo $post->comments->pingbacks->approved->count; ?> <?php echo _n( 'Pingback', 'Pingbacks', $post->comments->pingbacks->count ); ?> <?php _e('to'); ?> <?php echo $post->title; ?></h3>
			<ul id="pings-list">
				<?php foreach ( $post->comments->pingbacks->approved as $pingback ) : ?>
					<li id="ping-<?php echo $pingback->id; ?>">
						<div class="comment-content">
							<?php echo $pingback->content; ?>
						</div>
						<div class="ping-meta"><a href="<?php echo $pingback->url; ?>" title=""><?php echo $pingback->name; ?></a></div>
					</li>
				<?php endforeach; ?>
			</ul>
	<?php endif; */ ?>
	<?php if ( $post->comments->moderated->count ) : ?>
		<h3><?php echo $post->comments->comments->approved->count; ?> <?php echo _n( 'Response', 'Responses', $post->comments->comments->approved->count ); ?> <?php _e('to'); ?> <?php echo $post->title; ?></h3>
		<ul id="commentlist">
			<?php
				$odd = '';		
				foreach ( $post->comments->moderated as $comment ) :
					$class = 'class="comment';
					if ( $comment->status == Comment::STATUS_UNAPPROVED ) {
						$class.= '-unapproved';
					}
					$odd = ( $odd == '' ? ' odd' : '' );
					$class.= $odd . ' clear"';

			?>	
			<li id="comment-<?php echo $comment->id; ?>" <?php echo $class; ?>>
			    <div class="comment-meta">
      				<img src="<? 
      				if($comment->gravatar != "") {
      					echo $comment->gravatar; 
      				} else {
      					echo Site::out_url('theme', '/images/gravatar.png'); 
      				}
      				?>" alt="gravatar">
    			    <h4>
    					<?php if( $comment->url != "")  { ?>
    					<a href="<?php echo $comment->url; ?>" rel="external"><?php echo $comment->name; ?><span>
    					<?php echo $comment->url; ?></span></a>
    					<?php } else {
    						echo $comment->name;
    					} ?>
    				</h4>
    				<span class="cal"><a href="#comment-<?php echo $comment->id; ?>" title="<?php _e('Time of this comment'); ?>">
    				<?php $comment->date->out('F j H:m'); ?></a></span>			
   	     			<?php if ( $comment->status == Comment::STATUS_UNAPPROVED ) : ?><h5><em><?php _e('In moderation'); ?></em></h5><?php endif; ?>
			    </div>
			    <div class="comment-content">
			        <?php echo $comment->content_out; ?>
			    </div>
			</li>
			<?php endforeach; ?>
		</ul>
	<?php endif; ?>
	</section>
<?php endif; ?>
<?php if ( ! $post->info->comments_disabled ) :	?>
	<section id="commentform">	
		   	<h2><a href="#comments"><?php echo _( 'Contribute!' ); ?></a></h2>
			<?php $post->comment_form()->out(); ?>

	</section>
<?php endif; ?>